var express = require('express');
var router = express.Router();
const foodModel = require('../models/FoodModel')
const shopModel = require('../models/ShopModel')

//食物列表
router.get('/fd', async (req, res) => {
    const data = await foodModel.find()
    res.send({
        data
    })
})
//商店
router.get('/sp', async (req, res) => {
    const { id } = req.query
    const data = await foodModel.findOne({ _id: id }).populate('sid')


    res.send({
        data
    })
})

router.get('/shop', async (req, res) => {

    const data = await shopModel.find()

    res.send({
        data
    })
})





module.exports = router;
